#coding=utf-8

book="./data/book.csv"
newbook="./data/newbook.csv"
import csv,os
# with open(book,encoding='utf-8')as read,open(newbook,'w',newline='',encoding='utf-8')as fo:
#     f=csv.reader(read)
#     writer = csv.writer(fo)
#     for i in f:
#         if "价格" not in i[2]:
#             if float(i[2])>=50:
#                 print(i)
#                 csv.writer(fo)
#                 writer.writerow(i)

with open(book,encoding='utf-8')as rf:
    reader=csv.reader(rf)
    header=next(reader)#获取头部信息
    print(header)
    with open( newbook, 'w', newline='', encoding='utf-8' )as wf:
        writer=csv.writer(wf)
        writer.writerow(header)
        for one in list(reader):
            print(one)
            if float(one[2])>=50:
                csv.writer(wf)
                writer.writerow(one)



